//
//  HLSquareListRequest.m
//  YueYue
//
//  Created by hulu001 on 2023/5/18.
//

#import "HLSquareListRequest.h"

@implementation HLSquareListRequest
{
    NSString *_code;
}

- (id)initWithCode:(NSString *)code
{
    self = [super init];
    
    if (self) {
        _code = code;
        self.page = 1;
    }
    
    return self;
}

- (NSString *)requestUrl
{
    return @"/get/customers";
}

- (YTKRequestMethod)requestMethod
{
    return YTKRequestMethodGET;
}

- (id)requestArgument
{
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:@{@"chatGroupCode": _code, @"pageSize":HLListPageSize, @"pageNum":@"1"}];
    return params;
}

- (NSArray <HLSquareUserModel *> *)squareList
{
    NSArray *lists = @[];
    
    NSArray *records = [self.result valueForKey:@"data"];
    
    if (records.count > 0) {
        lists = [HLSquareUserModel mj_objectArrayWithKeyValuesArray:records];
    }
    
    return lists;
}


@end
